//
//  FMShareDataBase.m
//  wanzhaoIM
//
//  Created by wanzhao on 15/10/26.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import "FMShareDataBase.h"
#import "CFolderMgr.h"

@interface FMShareDataBase ()

@property (nonatomic, copy) NSString *path;

@end


@implementation FMShareDataBase


+(instancetype)shareDataBase
{
    static FMShareDataBase *instance  = nil;
    static dispatch_once_t dispatch_onces;
    if(instance  == nil)
    {
        dispatch_once(&dispatch_onces, ^{
            
            instance = [[FMShareDataBase alloc] init];
            
        });
    }
    return instance;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.commonShareQueue = [FMDatabaseQueue databaseQueueWithPath:[[CFolderMgr shareInstance] commonDatabasePath]];
    }
    return self;
}

- (void)updatePersonalQueue
{
    self.shareQueue = nil;
    self.shareQueue = [FMDatabaseQueue databaseQueueWithPath:[[CFolderMgr shareInstance] personalDatabasePathRecently]];
//    NSLog(@"路径%@",[[CFolderMgr shareInstance] personalDatabasePathRecently]);
}

- (void)updateCompanyQueue
{
    self.companyShareQueue = nil;
    self.companyShareQueue = [FMDatabaseQueue databaseQueueWithPath:[[CFolderMgr shareInstance] companyCommonDatabasePath]];

}

@end
